#ifndef CAMERA_H
#define CAMERA_H

#include <QWidget>
#include <QCamera>//用于打开系统的摄像头设备
#include <QCameraImageCapture>//用于截图
#include <QCameraViewfinder>//用于显示捕获的视频，
#include <QCameraInfo>
#include <QFileDialog>
#include <QDebug>
#include <QMessageBox>

namespace Ui {
class camera;
}

class camera : public QWidget
{
    Q_OBJECT

public:
    explicit camera(QWidget *parent = nullptr);
    ~camera();
    QCamera *ca;
    QCameraViewfinder *viewfinder;
    QCameraImageCapture *imageCapture;
private slots:
    void clicked();
    void saveImage(int id, const QImage &preview);
    void closeEvent(QCloseEvent *event);
private:
    Ui::camera *ui;
};

#endif // CAMERA_H
